commonlibsse_ng\re\t/
TESBoundObject.rs

1use core::ffi::{c_char, c_int, c_void};
2
3use crate::re::TESObject::TESObject;
4
5#[repr(C)]
6#[derive(Debug, Clone, Copy)]
7pub struct NiNPShortPoint3 {
8    pub x: i16,
9    pub y: i16,
10    pub z: i16,
11}
12const _: () = assert!(std::mem::size_of::<NiNPShortPoint3>() == 0x6);
13
14#[repr(C)]
15#[derive(Debug, Clone, Copy)]
16pub struct BOUND_DATA {
17    pub bound_min: NiNPShortPoint3,
18    pub bound_max: NiNPShortPoint3,
19}
20const _: () = assert!(std::mem::size_of::<BOUND_DATA>() == 0xC);
21
22#[repr(C)]
23#[derive(Debug)]
24pub struct TESBoundObject {
25    pub __base: TESObject,
26    pub bound_data: BOUND_DATA,
27    pub pad2C: u32,
28}
29const _: () = assert!(std::mem::size_of::<TESBoundObject>() == 0x30);
30
31#[repr(C)]
32pub struct TESBoundObjectVtbl {
33    // TESObject vtable entries
34    pub destructor: unsafe extern "C" fn(this: *mut TESBoundObject),
35    pub LoadObjectBound: unsafe extern "C" fn(this: *mut TESBoundObject, a_mod: *mut c_void),
36    pub IsBoundObject: unsafe extern "C" fn(this: *const TESBoundObject) -> bool,
37    pub Activate: unsafe extern "C" fn(
38        this: *mut TESBoundObject,
39        target_ref: *mut c_void,
40        activator_ref: *mut c_void,
41        arg3: u8,
42        object: *mut TESBoundObject,
43        target_count: c_int,
44    ) -> bool,
45    pub Clone3D: unsafe extern "C" fn(
46        this: *mut TESBoundObject,
47        ref_: *mut c_void,
48        arg3: bool,
49    ) -> *mut c_void,
50    pub ReplaceModel: unsafe extern "C" fn(this: *mut TESBoundObject) -> bool,
51
52    // TESBoundObject-specific methods
53    pub SetObjectVoiceType:
54        unsafe extern "C" fn(this: *mut TESBoundObject, voice_type: *mut c_void),
55    pub GetObjectVoiceType: unsafe extern "C" fn(this: *const TESBoundObject) -> *mut c_void,
56    pub Clone3D_2:
57        unsafe extern "C" fn(this: *mut TESBoundObject, ref_: *mut c_void) -> *mut c_void,
58    pub ReplaceModel_2: unsafe extern "C" fn(this: *mut TESBoundObject, str: *const c_char) -> bool,
59    pub GetActivateText: unsafe extern "C" fn(
60        this: *mut TESBoundObject,
61        activator: *mut c_void,
62        dst: *mut c_void,
63    ) -> bool,
64    pub CalculateDoFavor: unsafe extern "C" fn(
65        this: *mut TESBoundObject,
66        activator: *mut c_void,
67        arg2: bool,
68        to_activate: *mut c_void,
69        arg3: f32,
70    ) -> bool,
71    pub HandleRemoveItemFromContainer:
72        unsafe extern "C" fn(this: *mut TESBoundObject, container: *mut c_void),
73    pub OnRemove3D: unsafe extern "C" fn(this: *mut TESBoundObject, obj3D: *mut c_void),
74    pub OnCheckModels: unsafe extern "C" fn(this: *mut TESBoundObject),
75    pub OnCopyReference: unsafe extern "C" fn(this: *mut TESBoundObject),
76    pub OnFinishScale: unsafe extern "C" fn(this: *mut TESBoundObject),
77}